public class Rook implements Piece {

    private Color color;
    private int moveCount;

    public Rook( Color color ) {
  this.color = color;
	moveCount = 0;
    }

    public boolean legalMove( int x1, int y1, int x2, int y2 ) {
	if( (y2 == y1) && (x2 == x1) ) {
	    return false;
	}
	if( x2 == x1 ) {
	    return true;
	} else if( y2 == y1 ) {
	    return true;
	}
	return false;
    }

    public Color color() {
	return color;
    }

    public String name() {
	return "Rook";
    }

    public void movesPlusOne() {
	moveCount += 1;
    }
    
    public int moveCount() {
	return moveCount;
    }


}
